<script>
	function gettheloaitin() {
		var id = document.getElementById("idtp").value;
		$("#idquan").load("admin/librarys/incs/getloai.php?table=quan&loai=idtp&id="+id);
	}
</script>
<?
	$quangcao_index=$t->layquangcao(4);
	$row_quangcao_index=mysql_fetch_assoc($quangcao_index);
?>
<form action="<?=$rooturl?><?=$list[8]['alias']?>.html" method="get">
<table width="940" border="0" align="center" style="margin-top:5px;">
  <tr style="font-weight:bold;">
    <td>Chọn thành phố</td>
    <td>Tìm kiếm</td>
    <td>Lĩnh vực</td>
    <td>Quận</td>
    <td>&nbsp;</td>
    <td rowspan="2" style="text-align:center;">
    <a href="<?=$row_quangcao_index['file']?>">
    <img src="images/bg_dowload.png" />
    </a>
    </td>
  </tr>
  <tr>
    <td><select name="idtp" id="idtp" onchange="gettheloaitin()">
                    		<?php 
                    			$idparent = 0;
                    			$tinroot= $t->get_by_thutu('thanhpho');
                    			while($row=mysql_fetch_assoc($tinroot)) {
                    				if ($idparent==0) $idparent=$row['id'];
                    		?>
                    		<option value="<?php echo $row['id']; ?>"><?php echo $row['ten_vi']; ?></option>
                    		<?php 
                    			}
                    		?>
                    	</select></td>
    <td><input type="text" name="keyword" id="keyword"></td>
    <td><select name="idloai" id="idloai">
                    		<option value="0"> - - Tất cả - - </option>
                           <?php 
                    			$tintheloai = $t->get_by_thutu("sanpham_loai", -1,-1);
                    			while($rowtheloai=mysql_fetch_assoc($tintheloai)) {
                    		?>
                    		<option value="<?php echo $rowtheloai['id']; ?>"><?php echo $rowtheloai['ten_vi']; ?></option>
                    		<?php 
                    			}
                    		?>
                    	</select></td>
    <td><select name="idquan" id="idquan" >
                    		<option value="0"> - - Chọn loại quận - - </option>
                    		<?php 
                    			$tintheloai = $t->get_by_thutu("quan", -1,-1, " and idtp='$idparent'");
                    			while($rowtheloai=mysql_fetch_assoc($tintheloai)) {
                    				//if ($record['idtl']==$rowtheloai['id']) $idparent2=$rowtheloai['id'];
                    		?>
                    		<option value="<?php echo $rowtheloai['id']; ?>"><?php echo $rowtheloai['ten_vi']; ?></option>
                    		<?php 
                    			}
                    		?>
                    	</select></td>
    <td><input type="submit" name="ok" value="" style="background:url(images/btn_tim.png); width:90px;height:32px;;border:none;" /></td>
  </tr>
</table>
</form>
